<template>
	<!-- 添加弹框 -->
	<el-dialog  width="1000px" visible :show-close="false" closeOnClickModal  :append-to-body="true" class="wrap" @close="cancel" :close-on-click-modal="false">
		<i class="el-icon-close close" @click="cancel" style="color: white;"></i>
	    <div class="bt">行政模块</div>
			<div class="bmjf">
			<div class="top" v-if="this.qxbtn.c001x">
			<!--<router-link to="/educa/student">-->
				<div class="tp" @click="baoming(1)" style="background:#2BB4F4;color: white;"><i class="el-icon-plus"  style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">新生报名</span></div>
			<!--</router-link>-->
			</div>	
			
			<!--@click="baoming(2)"-->
			<!--<div class="top" v-if="this.qxbtn.c002x">
			<router-link to="/educa/student">
				<div class="tp"  style="background:#DD71F6;color: white;"><i class="el-icon-printer" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">催缴补缴</span></div>
			</router-link>
			</div>-->
			
			<div class="top" v-if="this.qxbtn.c049x">
			<router-link to="/cost/payjl">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-circle-plus-outline" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">缴费催缴</span></div>
			</router-link>
			</div>
			
			<div class="top" >
			<router-link to="/cost/ddlb">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-tickets" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">订单列表</span></div>
			</router-link>
			</div>
			
			<!--<div class="top" v-if="this.qxbtn.c003x">
			<router-link to="/admin/xsda" >
			<div class="tp"  style="background:#8D4FF2;color: white;"><i class="el-icon-document" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">学生档案</span></div>
			</router-link>
			</div>-->
			
			<div class="top" v-if="this.qxbtn.c004x">
			<router-link to="/cost/xstf" >
			<div class="tp"  style="background:#E340FF;color: white;"><i class="el-icon-remove-outline" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">退费退学</span></div>
			</router-link>
			</div>
			
			<!--<div class="top" v-if="this.qxbtn.c061x">
			<router-link to="/cost/wptf">
				<div class="tp" style="background:#E6A23C;color: white;"><i class="el-icon-delete" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">物品退费</span></div>
			</router-link>
			</div>-->
			
			<!--<div class="top" v-if="this.qxbtn.c005x">
			<router-link to="">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-circle-plus-outline" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">休学办理</span></div>
			</router-link>
			</div>-->
			
			<!--v-if="this.qxbtn.c062x"-->
			<div class="top" v-if="this.qxbtn.c062x">
			<router-link to="/admin/xszx">
				<div class="tp" style="background:#EE3C3F;color: white;"><i class="el-icon-sort" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">学生转校</span></div>
			</router-link>
			</div>
			
			<div class="top" v-if="this.qxbtn.c006x">
			<router-link to="/educa/msg">
				<div class="tp" style="background:#F56C6C;color: white;"><i class="el-icon-bell" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">发送通知</span></div>
			</router-link>
			</div>
			
			<!--<div class="top" v-if="this.qxbtn.c007x">
			<router-link to="/admin/pingjiasend"  >
			<div class="tp"  style="background:#409EFF;color: white;"><i class="el-icon-mobile-phone" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">发起评价</span></div>
			</router-link>
			</div>-->
			
			<div class="top" v-if="this.qxbtn.c008x">
			<router-link to="/admin/pingjia" >
			<div class="tp"  style="background:#575DEE;color: white;"><i class="el-icon-setting" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">评价老师</span></div>
			</router-link>
			</div>
			
			<!--<div class="top" v-if="this.qxbtn.c047x">
			<router-link to="/cost/txxx">
				<div class="tp" style="background:#F34744;color: white;"><i class="el-icon-tickets" style="margin: 10px 0;font-size:30px;"></i><br><span style="font-size:16px ;">休课名单</span></div>
			</router-link>
			</div>-->

			</div>
		<div v-if='aa' style="width: 100%;text-align: center;color: red;font-size: 20px;">您没有权限操作该模块里的功能！</div>
		<PayArticle class="wpfl1" @jcarticle="jcarticleed"  @close="jcarticlecancel" v-if="showarticle"></PayArticle>
		<qxszComponent v-if="qxsz1"  @close="componentsHide"  :params="111"></qxszComponent>
		<Kschoose class="wpfl" @wpchoose="wpchooseed" @close="wpchoosecancel" v-if="showchoselist"></Kschoose>
		<Homebaominglist v-if="showbaoming" @close="baomingtoggle" :params="this.zt"></Homebaominglist>
	</el-dialog>
</template>
<script type="text/javascript">
	import Kschoose from '../../manage/kssz/kschoose'
	import qxszComponent from '@/view/admin/personManage/ryqxsz'
	import Homebaominglist from '@/view/cost/baoming/add'
	import PayArticle from './pay-articlejc'
	import qs from 'qs'
	export default {
		components: { Kschoose, PayArticle,qxszComponent,Homebaominglist },
		data() {
			return {
				//查看权限
				aa:true,
				qxsz1:false,
				showbaoming:false,
				qxbtn:{
					c001x:false,
					c002x:false,
					c003x:false,
					c004x:false,
//					c005x:false,
					c006x:false,
					c007x:false,
					c008x:false,
					c047x:false,
					c049x:false,
					c061x:false,
					c062x:false,
				},
				zt:'',
				showchoselist: false,
				showarticle: false,
				vfxkcid: '',
				vfxkcidmc: '',
				vmc: '',
				vbtime:'',
				vlsid: '',
				vcid: '',
				vjcid: '',
				vjcidmc: '',
				vlx: '',
				vypks: '',
				xzls:'',
				comboxlist: [],
				dialogTableVisible: true,
				xzlsList: []
			}
		},
		created() {
			     //权限
				 var logininfo = JSON.parse(localStorage.logininfo) ;
                 this.qxbtn.c001x = (logininfo.auth.indexOf("c001x")!=-1);
                 this.qxbtn.c002x = (logininfo.auth.indexOf("c002x")!=-1);
                 this.qxbtn.c003x = (logininfo.auth.indexOf("c003x")!=-1);
                 this.qxbtn.c004x = (logininfo.auth.indexOf("c004x")!=-1);
//               this.qxbtn.c005x = (logininfo.auth.indexOf("c005x")!=-1);
                 this.qxbtn.c006x = (logininfo.auth.indexOf("c006x")!=-1);
                 this.qxbtn.c007x = (logininfo.auth.indexOf("c007x")!=-1);
                 this.qxbtn.c008x = (logininfo.auth.indexOf("c008x")!=-1);
                 this.qxbtn.c047x = (logininfo.auth.indexOf("c047x")!=-1);
                 this.qxbtn.c049x = (logininfo.auth.indexOf("c049x")!=-1);
                 this.qxbtn.c061x = (logininfo.auth.indexOf("c061x")!=-1);
                 this.qxbtn.c062x = (logininfo.auth.indexOf("c062x")!=-1);
                 if(logininfo.auth.indexOf("c001x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c002x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c003x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c004x")!=-1){
                 	this.aa=false;
                 }
//               else if(logininfo.auth.indexOf("c005x")!=-1){
//               	this.aa=false;
//               }
                 else if(logininfo.auth.indexOf("c006x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c007x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c008x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c047x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c049x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c061x")!=-1){
                 	this.aa=false;
                 }
                 else if(logininfo.auth.indexOf("c062x")!=-1){
                 	this.aa=false;
                 }
//          console.log(logininfo,'fffff')
			this.getcomboxlist();
			this.getxzlsList();
		},
		methods: {
			baoming(zt){
				this.zt = {zt:zt}
				this.showbaoming = true
			},
			baomingtoggle(){
				this.showbaoming = false
			},
			qxsz(){
				this.qxsz1=true
			},
			getxzlsList () {
				var logininfo = JSON.parse(localStorage.logininfo);
					this.axios.get( this.$store.state.api + 'ls/xzxzls', {
							params: {
								yhid: logininfo.id,
								xxid:logininfo.xxid
							}
					})
					.then( res => {
							console.log(res)
							this.xzlsList = res.data.data;
					}).catch( res => {
							console.log(res)
					})
			},
			submit() {
				//检测
				this.$store.state.loading = true;
				if(!this.vfxkcid) {
					this.$message.warning('请选择分校课程');
					this.$store.state.loading = false;
					return;
				}
				var time1 = this.$.getLocalTimeNo0(Date.parse(this.vbtime));
				var logininfo = JSON.parse(localStorage.logininfo);
				var params3 = qs.stringify({
					xzid:this.xzls,
					fxkcid: this.vfxkcid,
					mc: this.vmc,
					lsid: this.vlsid,
					cid: this.vcid,
					jcid: this.vjcid,
					lx: 'cj',
					ypks: '0',
					yhid: logininfo.id,
					xxid: logininfo.xxid,
					kbrq:time1
				});
				//执行
				this.axios.post(this.$store.state.api + 'bj/insert', params3)
					.then(res => {
						if(res.data.code == 1) {
							this.$emit('close', { type: 'bmjf', cancel: false });
							this.$store.state.loading = false;
						} else {
						    this.$message.warning(res.data.msg);
							this.$store.state.loading = false;
						}
					}).catch(res => {
						this.$message.warning("服务器繁忙，请重试");
						this.$store.state.loading = false;
					})
			},
			showwp() {
				this.showchoselist = true;
			},
			showjc() {
				this.showarticle = true;
			},
			wpchooseed(josndata) {
				this.vfxkcidmc = josndata.kcmc;
				this.vfxkcid = josndata.fxkcid;

				this.showchoselist = false;
			},
			jcarticleed(josndata) {
			    this.vcid = josndata.cid;
			    this.vjcid = josndata.jcid;
			    this.vjcidmc = josndata.jcidmc;
				this.showarticle = false;
			},
			wpchoosecancel() {
				this.showchoselist = false;
			},
			jcarticlecancel() {
				this.showarticle = false;
			},
			cancel() {
				this.$emit('close', { type: 'bmjf', cancel: true })
			},
			getcomboxlist() {
				var logininfo = JSON.parse(localStorage.logininfo);
				this.searchLoading = true;
				this.axios.get(this.$store.state.api + 'ls/getlslist',{
					params: {
						yhid: logininfo.id,
						xxid: logininfo.xxid
					}
				}).then(res => {
					console.log(res)
					let data = res.data.data;
					let list = data.list;
					this.comboxlist = list;
					console.log(this.comboxlist)
				}).catch(res => {
					console.log(res)
					this.searchLoading = false;
				})
			},
			componentsHide (setting) { //关闭组件
					console.log(setting)
					this.qxsz1=false
			}
		}
	}
</script>
<style lang="less" scoped >
	.wrap {
		.row{
			height:50px;
			line-height: 50px;
		}
		.bt{
			position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top: 0;
			left: 0;
			// margin-top: -70px;
			background: #50BFFF;
			// margin-left: -20px;
			// margin-bottom: 20px;
			color:white;
			text-align:left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
	.close{
			    top: 10px;
			    font-size: 25px;
				z-index: 10;
				position: absolute;
		}
		.top{
			width: 140px;
		height: 80px;
		// float: left;
		border-radius: 8px;
		margin-right: 15px;
		margin-top: 20px;
		background: white;
		cursor: pointer;
		// position: absolute;
		box-shadow: 7px 7px 7px #B3B3B3;
		border-radius: 8px;
		}
		.tp {
		width: 100%;
		height: 80px;
		// float: left;
		border-radius: 8px;
		background: white;
		// position: absolute;
		box-shadow: 7px 7px 7px #B3B3B3;
		border-radius: 8px;
	}
	.top:hover{
			 transform:scale(1.1);
	        -ms-transform:scale(1.1);
	        -webkit-transform:scale(1.1);
	        -o-transform:scale(1.1);
	        -moz-transform:scale(1.1);
		}
		.bmjf{
			display: flex;
			justify-content: space-around;
			flex-flow: wrap;
			width: 100%;
			height:100%;
			margin: 0 auto;
			/*margin-bottom: 25px;*/
			// float: left;
			/*margin-top: 52px;*/
	/*		margin-bottom: 10px;*/
			color: white;
			text-align: center;
			font-size: 16px;
	/*		background: white;*/
	/*		border-top: 3px solid deepskyblue;*/
		}
	}
</style>
